import request from '../../utils/request'
import { GET_USERINFO } from '../actionTypes'
export const getUseInfo = () => {
  return async (dispatch) => {
    //  1.  发送ajax
    const res = await request({
      url: '/user',
      method: 'GET'
    })
    console.log('userinfo', res)
    // // 2. 保存token到redux
    dispatch({ type: GET_USERINFO, payload: res.data })
  }
}
